package com.polight.simplelocation.locationserver;

import java.util.Calendar;

public class LocationInfo {
	private String key = null;
	private double longitude = 0;
	private double latitude = 0;
	private long time = 0;
	
	public String getKey() {
		return key;
	}
	public void setKey(String key) {
		this.key = key;
	}
	public double getLongitude() {
		return longitude;
	}
	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}
	public double getLatitude() {
		return latitude;
	}
	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}
	public long getTime() {
		return time;
	}
	public void setTime(long time) {
		this.time = time;
	}
	
	public String toString() {
		Calendar c = Calendar.getInstance();
		c.setTimeInMillis(time);
		int year = c.get(Calendar.YEAR);
		int month = c.get(Calendar.MONTH) + 1;
		int day = c.get(Calendar.DAY_OF_MONTH);
		int hour = c.get(Calendar.HOUR);
		int minute = c.get(Calendar.MINUTE);
		int second = c.get(Calendar.SECOND);
		String date = "" + year + "-" + month + "-" + day +"," + hour + ":" + minute + ":" + second;
		return "" + date + "\t<" + longitude + "," + latitude + ">";
	}
	
	public double CalDistance(LocationInfo info) {
		return 0;
	}
}
